package org.andes.kownledge.operator;

import java.util.ArrayList;
import java.util.List;

import org.andes.base.Bindings;

public class Identifier extends Term{
	private List<Term> arguments=new ArrayList<Term>();

	private String opName;
	public Identifier(String s) {
		opName=s;
	}
	public void setOpName(String s){
		opName=s;
		
	}
	public String getOpName(){
		return opName;
	}
	@Override
	public Term renameVariable() {
		Identifier result=new Identifier(opName);
		for(Term var:arguments){
			result.addArgument((Variable) var.renameVariable());
		}
		return result;
	}

	@Override
	public Term substBindings(Bindings bindings) {
		Identifier result=new Identifier(opName);
		for(Term var:arguments){
			result.addArgument( var.substBindings(bindings));
		}
		return result;
	}
	public void addArgument(Term var){
		arguments.add(var);
	}
	
	public void addArgument(List<Term> vars){
		arguments.addAll(vars);
	}
	public String toString(){
		return opName;
	}
}
